<!DOCTYPE html>
<html>
<head>
    <title>领料单</title>
    #parse("sys/header.html")
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <Row :gutter="16" style="margin: 8px 0px 0px 1px">
            <div class="search-group">
                <i-col span="4">
                    <i-input v-model="q.materCode" @on-enter="query" placeholder="领料单编号"/>
                </i-col>
                <i-col span="4">
                    <i-select v-model="q.progress" placeholder="领料单状态">
                        <i-option v-for="item in materProgress" :value="item.value" :key="item.value">{{item.name}}
                        </i-option>
                    </i-select>
                </i-col>
                <i-col span="4">
                    <i-input v-model="q.picker" @on-enter="query" placeholder="领料人"></i-input>
                </i-col>
                <i-button @click="query">查询</i-button>
                <i-button @click="reloadSearch">重置</i-button>
            </div>
        </Row>
        <Row style="margin: 3px 0px 0px 0px;">
            <div class="buttons-group">
                #if($shiro.hasPermission("materialbase:save"))
                <i-button type="info" @click="commit"><i class="fa fa-plus"></i>&nbsp;提交审核</i-button>
                #end
                #if($shiro.hasPermission("materialbase:check"))
                <i-button type="info" @click="check"><i class="fa fa-plus"></i>&nbsp;审核</i-button>
                #end

                #if($shiro.hasPermission("materialbase:out"))
                <i-button type="primary" @click="outMater"><i class="fa fa-plus"></i>出库</i-button>
                #end

                #if($shiro.hasPermission("materialbase:save"))
                <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
                #end
                #if($shiro.hasPermission("materialbase:update"))
                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
                #end
                #if($shiro.hasPermission("materialbase:delete"))
                <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
                #end
            </div>
        </Row>
        <table id="jqGrid"></table>
    </div>

    <Card v-show="!showList">
        <p slot="title">{{title}}</p>
        <i-form ref="formValidate" :model="materialBase" :rules="ruleValidate" :label-width="80">
            <Row>
                <i-col span="11">
                    <Form-item label="用途" prop="purpose">
                        <i-input type="textarea" v-model="materialBase.purpose" placeholder="用途"/>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Form-item label="备注信息" prop="remark">
                        <i-input type="textarea" v-model="materialBase.remark" placeholder="备注信息"/>
                    </Form-item>
                </i-col>
            </Row>
            <Form-item>
                <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
                <i-button type="warning" @click="reload" style="margin-left: 8px"/>
                返回</i-button>
                <i-button type="info" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
            </Form-item>
        </i-form>
    </Card>

    <!-- 备件审核弹窗 -->
    <div id="check_ok" style="display: none;">
        <i-form :label-width="80">
            <div class="form-group">
                <div class="form-group">
                    <Row>
                        <i-col span="22">
                            <Form-item label="审核状态">
                                <i-select v-model="checkData.progress" class="form-input">
                                    <i-option v-for="item in checkList" :value="item.value" :key="item.value">{{item.name}}</i-option>
                                </i-select>
                            </Form-item>
                        </i-col>
                    </Row>
                    <Row>
                        <i-col span="22">
                            <Form-item label="备注信息">
                                <i-input type="textarea" v-model="checkData.checkRemark" rows="3" placeholder="备注信息"></i-input>
                            </Form-item>
                        </i-col>
                    </Row>
                </div>
            </div>
            <!--        </form>-->
        </i-form>
    </div>
</div>

<script src="${rc.contextPath}/js/tools/materialbase.js?_${date.systemTime}"></script>
</body>
</html>
